clear
clc

[num,txt,raw] = xlsread('compare_aggregate.xls');

start=37;
% 2013m1 to 2019m6 data
ln_export_tot=num(start:end-6,3);
ln_export_tot_city=num(start:end-6,4);
ln_export_us_tot=num(start:end-6,7);
ln_export_us_tot_city=num(start:end-6,8);

time = datenum(2013,[1:((2019-2013)+1)*12].',1);
time=time(start:end-6);


%generate Figure A1 (a)
figure(1)

[hAx,hLine1,hLine2] = plotyy(time,ln_export_tot,time,ln_export_tot_city-3);
hLine1.LineWidth =2;
hLine1.LineStyle ="--";
hLine2.LineWidth =2;
ylabel(hAx(1),'China') % left y-axis 
ylabel(hAx(2),'Our Sample City') % right y-axis
datetick(hAx(1), 'x', 'mm/dd/yyyy')
datetick(hAx(2), 'x', 'mm/dd/yyyy')
xlim(hAx(1),[time(1) time(end)])
xlim(hAx(2),[time(1) time(end)])


%generate Figure A1 (b)
figure(2)

[hAx,hLine1,hLine2] = plotyy(time,ln_export_us_tot,time,ln_export_us_tot_city-3);
hLine1.LineWidth =2;
hLine1.LineStyle ="--";
hLine2.LineWidth =2;
ylabel(hAx(1),'China') % left y-axis 
ylabel(hAx(2),'Our Sample City') % right y-axis
datetick(hAx(1), 'x', 'mm/dd/yyyy')
datetick(hAx(2), 'x', 'mm/dd/yyyy')
xlim(hAx(1),[time(1) time(end)])
xlim(hAx(2),[time(1) time(end)])




